#pragma once 
using namespace std;
#include<iostream>
#include<cstdlib>
#include<vector>
#include<ctime>
typedef void(*task_t)();
void printlog()
{
    cout<<"这是一个打印日志的项目"<<endl;
}
void download()
{
    cout<<"这是一个下载项目"<<endl;
}
void upload()
{
    cout<<"这是一个上传项目"<<endl;
}
class taskmanage
{
    public:
    taskmanage()
    {
        srand(time(nullptr));
    }
    void Register(task_t t)
    {
        tasks.emplace_back(t);
    }
    int Code()
    {
        return rand()%tasks.size();
    }
    void Execute(int code)
    {
        if(code>=0&&code<tasks.size())
        {
            tasks[code]();
        }
    }
    ~taskmanage()
    {
    }
    private:
    vector<task_t>tasks;
};